package com.example.demo.config;

import com.example.demo.CustomCommandLineRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

@EnableConfigurationProperties(CustomProperties.class)
public class Lab2AutoConfig {
    @Bean
    @ConditionalOnProperty(prefix = "demo.auto",name = "enable", havingValue = "true")
    CommandLineRunner creatCommandLineRunner(){
        return new CustomCommandLineRunner();
    }
}

